#version 320 es
layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec3 a_Normal;

uniform mat4 u_ModelMatrix;
uniform mat4 u_ViewMatrix;
uniform mat4 u_ProjMatrix;

out vec3 v_normal;
out vec3 v_fragPos;

void main() {
    v_normal = mat3(transpose(inverse(u_ModelMatrix))) * a_Normal;
    v_fragPos = vec3(u_ModelMatrix * vec4(a_Position, 1.0));
    gl_Position = u_ProjMatrix * u_ViewMatrix  * vec4(v_fragPos, 1.0);
}